<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" template="/template/template_layout_lr.xhtml"
	xmlns:s="http://sduept.security.el/func">
	<ui:define name="head">
		<link rel="stylesheet" href="/resources/plugins/datatables/dataTables.bootstrap.css" />
		<style>
.chart svg {
width: 150% !important;
}
</style>
	</ui:define>
	<ui:define name="left-box-title">
	      	录波器配置
	</ui:define>
	<ui:define name="left-box-body">
		<p:confirmDialog global="true" showEffect="fade" hideEffect="fade">
			<p:commandButton value="是" type="button" styleClass="ui-confirmdialog-yes" icon="ui-icon-check" />
			<p:commandButton value="否" type="button" styleClass="ui-confirmdialog-no" icon="ui-icon-close" />
		</p:confirmDialog>
		<div class="box-header with-border" id="searchInput">
			<h:form id="form1">
				<p:growl id="msg" showDetail="true" />
				<h:selectOneMenu id="status" value="#{waveEquipmentController.voltage}"
					style="margin-right:10px;width:80px;height:28px">
					<p:ajax event="change" listener="#{waveEquipmentController.initTree}"  update="form2:tree form1" />
					<f:selectItem itemLabel="500kV" itemValue="500" />
					<f:selectItem itemLabel="220kV" itemValue="220" />
				</h:selectOneMenu>
				<p:autoComplete placeholder="输入拼音首字母可查询" id="in_station500" rendered="#{waveEquipmentController.voltage !=220}"
					value="#{waveEquipmentController.filterStation}"
					completeMethod="#{cimUtilController.completeCimStation500}" scrollHeight="400">
					<p:ajax update="in_station500 form2:tree" event="itemSelect"
						listener="#{waveEquipmentController.autoCompleteStation}" />
				</p:autoComplete>
				<p:autoComplete placeholder="输入拼音首字母可查询" id="in_station220" rendered="#{waveEquipmentController.voltage==220}"
					value="#{waveEquipmentController.filterStation}"
					completeMethod="#{cimUtilController.completeCimStation220}" scrollHeight="400">
					<p:ajax update="in_station220 form2:tree" event="itemSelect"
						listener="#{waveEquipmentController.autoCompleteStation}" />
				</p:autoComplete>
				<p:commandButton icon="fa fa-refresh" style="margin-left: 3px;" update="form2:tree" title="刷新"
					actionListener="#{waveEquipmentController.initTree()}"></p:commandButton>
				<p:commandButton icon="fa fa-tasks" title="一键生成"
					rendered="#{s:hasPermission(session,'xtsz_dwmx_bxsjmx_lbqpz_yjsc')}"
					actionListener="#{waveEquipmentController.generteAll}" update="msg">
					<p:confirm header="提示" message="一键生成耗时比较长，确定要重新生成?" icon="ui-icon-alert" />
				</p:commandButton>
			</h:form>
		</div>
		<div class="box-body  with-border">
			<h:form id="form2">
				<p:tree value="#{waveEquipmentController.root}"   style="width:400px;border:none"
					selectionMode="single" var="node" dynamic="true" id="tree" widgetVar="tree" animate="true">
					<p:ajax event="expand" update="tree" listener="#{waveEquipmentController.onNodeExpand}" />
					<p:ajax event="select" process="@this :form3:svg"  
						update=":form3:svg :equipmentInfoForm:equipmentInfoTb  
						          :anologForm:anologTb :digitForm:digitTb :exceptionForm  fileUploadForm waveForm:waveEquipmentDataTable"
						listener="#{waveEquipmentController.onNodeSelect}" oncomplete="showSvg()" />
					<p:treeNode type="station" icon="fa fa-home">
						<h:outputText value="#{node}" />
					</p:treeNode>
					<p:treeNode type="wave" icon="fa fa-cc-diners-club">
						<h:outputText value="#{node}" />
					</p:treeNode>
				</p:tree>
			</h:form>
		</div>
	</ui:define>
	<ui:define name="right-box-title">
	       详细信息
	</ui:define>
	<ui:define name="right-box-body">
		<div class="nav-tabs-custom" style="display: none;" id="tabView">
			<p:toolbar>
				<f:facet name="left">
					<p:commandButton id="autoBtn" value="生成通道" icon="fa fa-refresh "
						actionListener="#{waveEquipmentController.autoGenarate()}"
						rendered="#{s:hasPermission(session,'xtsz_dwmx_bxsjmx_lbqpz_sctd')}"
						update=":anologForm:anologTb :digitForm:digitTb :exceptionForm :form1:msg">
						<p:confirm header="提示" message="生成通道会删除现有的设备关联，确定要生成通道么？" icon="ui-icon-alert" />
					</p:commandButton>
					<p:commandButton id="relationBtn" value="关联一次设备" icon="fa fa-link"
						actionListener="#{waveEquipmentController.relationEquipment()}"
						rendered="#{s:hasPermission(session,'xtsz_dwmx_bxsjmx_lbqpz_glycsb')}"
						update=":anologForm:anologTb :digitForm:digitTb :exceptionForm :form1:msg">
						<p:confirm header="提示" message="关联一次设备会删除现有的设备关联，确定要关联么？" icon="ui-icon-alert" />
					</p:commandButton>
					<p:commandButton id="createDmf" value="生成dmf" icon="fa fa-refresh "
						actionListener="#{waveEquipmentController.createDmf()}"
						rendered="#{s:hasPermission(session,'xtsz_dwmx_bxsjmx_lbqpz_scdmf')}"
						update=":anologForm:anologTb     digitForm:digitTb  :digitForm:digitTb :exceptionForm :form1:msg">
					</p:commandButton>
					<p:commandButton id="seeDmf" value="查看dmf" oncomplete="PF('dmfInfoDialog').show()"
						icon="fa fa-search "
						rendered="#{s:hasPermission(session,'xtsz_dwmx_bxsjmx_lbqpz_ckdmf')}"
						update="dialogForm:dmfInfoDialog">
					</p:commandButton>
					<p:commandButton id="createCfg" value="生成cfg" icon="fa fa-refresh "
						rendered="#{s:hasPermission(session,'xtsz_dwmx_bxsjmx_lbqpz_sccfg')}"
						actionListener="#{waveEquipmentController.createCfg}" update=":form1:msg">
					</p:commandButton>
				</f:facet>
			</p:toolbar>
			<ul class="nav nav-tabs">
				<li class="active"><a href="#anologChannel" data-toggle="tab">模拟通道</a></li>
				<li><a href="#digitChannel" data-toggle="tab">数字通道</a></li>
				<li><a href="#exceptionmsg" data-toggle="tab">异常信息</a></li>
				<li><a href="#fileUpload" data-toggle="tab">文件上传</a></li>
			</ul>
			<div class="tab-content no-padding">
				<div class="chart tab-pane active" id="anologChannel">
					<h:form id="anologForm">
						<div class="box">
							<div class="box-header">
								<p:toolbar>
									<f:facet name="left">
										<p:commandButton value="关联设备" id="relationAn"
											actionListener="#{waveEquipmentController.getEquipmentByStation}" icon="fa fa-link"
											alt="关联设备" title="关联设备" disabled="#{waveEquipmentController.analogSelecteds.size() == 0}"
											rendered="#{s:hasPermission(session,'xtsz_dwmx_bxsjmx_lbqpz_mntd_glsb')}">
											<p:ajax event="dialogReturn" listener="#{waveEquipmentController.onAnologSelectorChosen}"
												update="anologForm:anologTb anologForm:msg" />
										</p:commandButton>
										<p:commandButton style="margin-left:2px" id="resetAn"
											actionListener="#{waveEquipmentController.resetgAnalogChannel()}"
											update=":anologForm:anologTb :form1:msg" icon="fa fa-refresh " alt="重置通道" title="重置通道"
											value="重置通道" disabled="#{waveEquipmentController.analogSelecteds.size() == 0}"
											rendered="#{s:hasPermission(session,'xtsz_dwmx_bxsjmx_lbqpz_mntd_zztd')}">
											<p:confirm header="提示" message="确定重置通道吗?" icon="ui-icon-alert" />
										</p:commandButton>
										<p:commandButton style="margin-left:2px"
											actionListener="#{waveEquipmentController.editAnologInfo()}"
											update="anologForm:anologInfoDialog" id="editAn"
											oncomplete="PF('anologInfoDialog').show()" icon="fa fa-pencil" alt="编辑" title="编辑"
											value="编辑" disabled="#{waveEquipmentController.analogSelecteds.size() != 1}"
											rendered="#{s:hasPermission(session,'xtsz_dwmx_bxsjmx_lbqpz_mntd_bj')}">
										</p:commandButton>
									</f:facet>
								</p:toolbar>
							</div>
							<div class="box-body  full-content-scroll">
								<p:growl id="msg" showDetail="true"></p:growl>
								<p:dataTable id="anologTb" var="anolog" emptyMessage="无记录"
									value="#{waveEquipmentController.anologInfo}" rowKey="#{anolog.id}"
									selection="#{waveEquipmentController.analogSelecteds}"
									style="margin-bottom:20px;text-align:center">
									<p:ajax event="rowSelectCheckbox"
										update="anologForm:editAn anologForm:resetAn anologForm:relationAn" />
									<p:ajax event="rowUnselectCheckbox"
										update="anologForm:editAn anologForm:resetAn anologForm:relationAn" />
									<p:ajax event="rowSelect"
										update="anologForm:editAn anologForm:resetAn anologForm:relationAn" />
									<p:ajax event="rowUnselect"
										update="anologForm:editAn anologForm:resetAn anologForm:relationAn" />
									<p:column selectionMode="multiple" style="width:40px;text-align:center" />
									<p:column headerText="通道号" style="width:80px;text-align: center">
										<h:outputText value="#{anolog.no}" />
									</p:column>
									<p:column headerText="通道名称">
										<h:outputText value="#{anolog.name}" />
									</p:column>
									<p:column headerText="关联设备">
										<h:outputText value="#{anolog.equipmentName}" />
									</p:column>
								</p:dataTable>
								<p:dialog id="anologInfoDialog" widgetVar="anologInfoDialog" height="150px">
									<p:toolbar>
										<f:facet name="right">
											<p:commandButton value="确定" actionListener="#{waveEquipmentController.saveAnologInfo}"
												update="form1:msg anologTb" oncomplete="PF('anologInfoDialog').hide()" />
										</f:facet>
									</p:toolbar>
									<p:panelGrid columns="2">
										<p:outputLabel value="通道名称" />
										<p:inputText style="width:300px" value="#{waveEquipmentController.analogSelected.name}" />
									</p:panelGrid>
								</p:dialog>
							</div>
							<div class="box-footer"></div>
						</div>
					</h:form>
				</div>
				<h:form id="dialogForm">
					<p:dialog id="dmfInfoDialog" header="查看dmf" widgetVar="dmfInfoDialog" height="600px"
						width="1100px" modal="true">
						<p:panel style="white-space:pre-wrap;">
							#{waveEquipmentController.seeDmf(waveEquipmentController.selectedWaveEquipment.dmf)}
				</p:panel>
					</p:dialog>
				</h:form>
				<div class="chart tab-pane" id="digitChannel">
					<h:form id="digitForm">
						<div class="box">
							<div class="box-header">
								<p:toolbar>
									<f:facet name="left">
										<p:commandButton actionListener="#{waveEquipmentController.getEquipmentByStation}"
											icon="fa fa-link" alt="关联设备" title="关联设备" value="关联设备" id="relationDigBtn"
											disabled="#{waveEquipmentController.digitSelecteds.size() == 0}"
											rendered="#{s:hasPermission(session,'xtsz_dwmx_bxsjmx_lbqpz_sztd_glsb')}">
											<p:ajax event="dialogReturn" listener="#{waveEquipmentController.onDigitSelectorChosen}"
												update="digitTb  anologForm:msg" />
										</p:commandButton>
										<p:commandButton icon="fa fa-refresh " alt="重置通道" value="重置通道" id="resetDigBtn"
											disabled="#{waveEquipmentController.digitSelecteds.size() == 0}"
											rendered="#{s:hasPermission(session,'xtsz_dwmx_bxsjmx_lbqpz_sztd_zztd')}"
											title="重置通道" style="margin-left:2px"
											actionListener="#{waveEquipmentController.resetgDigitalChannel()}"
											update=":digitForm:digitTb :form1:msg">
											<p:confirm header="提示" message="确定重置通道吗?" icon="ui-icon-alert" />
										</p:commandButton>
										<p:commandButton icon="fa fa-pencil" alt="编辑" title="编辑" value="编辑" id="editDigBtn"
											disabled="#{waveEquipmentController.digitSelecteds.size() != 1}"
											rendered="#{s:hasPermission(session,'xtsz_dwmx_bxsjmx_lbqpz_sztd_bj')}"
											style="margin-left:2px" update="digitForm:digitInfoDialog"
											actionListener="#{waveEquipmentController.editDigitInfo()}"
											oncomplete="PF('digitInfoDialog').show()" />
									</f:facet>
								</p:toolbar>
							</div>
							<div class="box-body full-content-scroll">
								<p:dataTable id="digitTb" var="digit" emptyMessage="无记录"
									value="#{waveEquipmentController.digitInfo}" rowKey="#{digit.id}"
									selection="#{waveEquipmentController.digitSelecteds}"
									style="margin-bottom:20px;text-align: center">
									<p:ajax event="rowSelectCheckbox"
										update="digitForm:relationDigBtn digitForm:resetDigBtn digitForm:editDigBtn" />
									<p:ajax event="rowUnselectCheckbox"
										update="digitForm:relationDigBtn digitForm:resetDigBtn digitForm:editDigBtn" />
									<p:ajax event="rowSelect"
										update="digitForm:relationDigBtn digitForm:resetDigBtn digitForm:editDigBtn" />
									<p:ajax event="rowUnselect"
										update="digitForm:relationDigBtn digitForm:resetDigBtn digitForm:editDigBtn" />
									<p:column selectionMode="multiple" style="width:40px;text-align:center" />
									<p:column headerText="通道号" style="width:80px;text-align: center">
										<h:outputText value="#{digit.no}" />
									</p:column>
									<p:column headerText="通道名称">
										<h:outputText value="#{digit.name}" />
									</p:column>
									<p:column headerText="关联设备">
										<h:outputText value="#{digit.equipmentName}" />
									</p:column>
								</p:dataTable>
								<p:dialog id="digitInfoDialog" widgetVar="digitInfoDialog" height="150px">
									<p:toolbar>
										<f:facet name="right">
											<p:commandButton value="确定"
												actionListener="#{waveEquipmentController.saveCfgDigitalChannel}"
												update="form1:msg digitTb " oncomplete="PF('digitInfoDialog').hide()" />
										</f:facet>
									</p:toolbar>
									<p:panelGrid columns="2">
										<p:outputLabel value="通道名称" />
										<p:inputText style="width:300px" value="#{waveEquipmentController.digitSelected.name}" />
									</p:panelGrid>
								</p:dialog>
							</div>
							<div class="box-footer"></div>
						</div>
					</h:form>
				</div>
				<div class="chart tab-pane" id="exceptionmsg">
					<div class="box">
						<div class="box-body full-content-scroll">
							<h:form id="exceptionForm">
								<p:inputTextarea id="exceptionTb" rows="#{waveEquipmentController.rowsCounts}"
									style="width:100%" readonly="true" value="#{waveEquipmentController.dmfMsg}">
								</p:inputTextarea>
							</h:form>
						</div>
						<div class="box-footer"></div>
					</div>
				</div>
				<div class="chart tab-pane" id="fileUpload">
					<div class="box">
						<div class="box-body full-content-scroll">
							<h:form id="fileUploadForm">
								<p:growl id="msgs" showDetail="true" />
								<p:toolbar>
									<f:facet name="left">
										<p:commandButton value="上传" icon="fa fa-upload"
											rendered="#{s:hasPermission(session,'xtsz_dwmx_bxsjmx_lbqpz_wjsc_sc')}"
											actionListener="#{waveEquipmentController.resetUploadedFileMap}"
											onclick="PF('uploadWaveFileDialog').show()" />
									</f:facet>
								</p:toolbar>
								<p:dataTable id="waveFiles" emptyMessage="无记录" var="waveFile"
									value="#{waveEquipmentController.waveFiles}" rowKey="#{waveFile.id}" paginator="true"
									paginatorPosition="bottom"
									paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
									rows="30" rowsPerPageTemplate="30,50,100" selectionMode="single"
									style="margin-bottom:20px;text-align:center">
									<p:column headerText="文件名称" width="250">
										<h:outputText value="#{waveEquipmentController.getFileName(waveFile.path)}" />
									</p:column>
									<p:column headerText="第一采样点时间" width="200">
										<h:outputText value="#{waveFile.startSecond}" />
									</p:column>
									<!-- <p:column headerText="第一采样点时间">
								<h:outputText value="#{waveFile.startMicro}" />
							</p:column> -->
									<p:column headerText="触发时间" width="200">
										<h:outputText value="#{waveFile.triggerSecond}" />
									</p:column>
									<!-- <p:column headerText="触发时间">
								<h:outputText value="#{waveFile.triggerMicro}" />
							</p:column> -->
									<p:column headerText="状态" width="200">
										<h:outputText value="#{waveFile.status}" />
									</p:column>
									<p:column headerText="操作" width="200">
										<p:commandButton title="删除" icon="fa fa-trash"
											rendered="#{s:hasPermission(session,'xtsz_dwmx_bxsjmx_lbqpz_wjscd_sc')}"
											actionListener="#{waveEquipmentController.deleteWaveFile(waveFile.id)}"
											update="waveFiles fileUploadForm:msgs">
											<p:confirm header="提示" message="确定删除该记录吗?" icon="ui-icon-alert" />
										</p:commandButton>
										<p:commandButton title="重新解析" icon="fa fa-refresh"
											rendered="#{s:hasPermission(session,'xtsz_dwmx_bxsjmx_lbqpz_wjsc_zxjx')}"
											actionListener="#{waveEquipmentController.reSetFileStatus(waveFile.id)}"
											update="waveFiles fileUploadForm:msgs">
											<p:confirm header="提示" message="确定重新解析么?" icon="ui-icon-alert" />
										</p:commandButton>
										<p:commandButton title="下载" icon="fa fa-download" ajax="false" 
											actionListener="#{waveEquipmentController.prepareDownload(waveFile)}"
											rendered="#{s:hasPermission(session,'jcsj_sjwh_ecsbwh_lbqpz_wjsc_xz')}"
											update="fileUploadForm:msgs">
											<p:fileDownload value="#{waveEquipmentController.file}"></p:fileDownload>
										</p:commandButton>
									</p:column>
								</p:dataTable>
								<p:dialog widgetVar="uploadWaveFileDialog" id="uploadWaveFileDialog" header="录波文件上传"
									modal="true" width="550" height="200">
									<p:fileUpload multiple="true"
										update="msgs waveFiles :anologForm:anologTb :digitForm:digitTb :exceptionForm @this"
										id="uploadCom" invalidFileMessage="文件扩展名必须是dat或者cfg"
										allowTypes="/(\.|\/)(cfg|dat|CFG|DAT)$/" label="选择" uploadLabel="上传" cancelLabel="取消"
										fileUploadListener="#{waveEquipmentController.handleWaveFileUpload}" fileLimit="2"
										fileLimitMessage="文件个数必须是2个" mode="advanced" />
								</p:dialog>
							</h:form>
						</div>
						<div class="box-footer"></div>
					</div>
				</div>
			</div>
		</div>
		<div class="nav-tabs-custom" style="display: none;" id="svgView">
			<ul class="nav nav-tabs">
				<li class="active"><a href="#svgInfo" data-toggle="tab">站内接线图</a></li>
				<li><a href="#equipmentInfo" data-toggle="tab">设备信息</a></li>
				<li><a href="#wave" data-toggle="tab">录波器</a></li>
			</ul>
			<div class="tab-content no-padding">
				<div class="chart tab-pane active " id="svgInfo">
					<div class="box">
						<div class="box-body full-content-scroll with-border">
							<h:form id="form3">
								<p:outputPanel id="svg">
									<div id="maindiv" class="row full-content"></div>
									<h:inputHidden id="svgtext" value="#{waveEquipmentController.svgContent}"></h:inputHidden>
								</p:outputPanel>
							</h:form>
						</div>
						<div class="box-footer"></div>
					</div>
				</div>
				<div class="chart tab-pane" id="wave">
					<div class="box">
						<div class="box-body full-content-scroll">
							<h:form id="waveForm">
								<p:confirmDialog global="true" showEffect="fade" hideEffect="fade">
									<p:commandButton value="是" type="button" styleClass="ui-confirmdialog-yes"
										icon="ui-icon-check" />
									<p:commandButton value="否" type="button" styleClass="ui-confirmdialog-no"
										icon="ui-icon-close" />
								</p:confirmDialog>
								<p:growl id="msgs" showDetail="true" />
								<p:toolbar id="toolbar">
									<f:facet name="left">
										<p:commandButton value="新建"
											rendered="#{s:hasPermission(session,'xtsz_dwmx_bxsjmx_lbqpz_lbq_xj')}"
											actionListener="#{waveEquipmentController.preCreateWaveEquipment}"
											oncomplete="PF('createWaveEquipment').show()" update="waveForm:createWaveEquipment" />
										<p:commandButton value="编辑"
											rendered="#{s:hasPermission(session,'xtsz_dwmx_bxsjmx_lbqpz_lbq_bj')}"
											actionListener="#{waveEquipmentController.editWaveEquipment}"
											oncomplete="PF('createWaveEquipment').show()"
											disabled="#{waveEquipmentController.selectWaveEquipment == null}"
											update="waveForm:createWaveEquipment waveEquipmentDataTable ">
										</p:commandButton>
										<p:commandButton value="删除"
											rendered="#{s:hasPermission(session,'xtsz_dwmx_bxsjmx_lbqpz_lbq_sc')}"
											disabled="#{waveEquipmentController.selectWaveEquipment == null}"
											actionListener="#{waveEquipmentController.deleteWaveEquipment}"
											update="msgs waveEquipmentDataTable  form2:tree waveForm">
											<p:confirm header="提示" message="确定删除该记录吗?" icon="ui-icon-alert" />
										</p:commandButton>
									</f:facet>
								</p:toolbar>
								<p:dataTable var="waveEquipment" emptyMessage="无记录" id="waveEquipmentDataTable"
									selectionMode="single" value="#{waveEquipmentController.waveEquipments}"
									selection="#{waveEquipmentController.selectWaveEquipment}" rowKey="#{waveEquipment.id}"
									style="margin-bottom:20px;text-align: center">
									<p:ajax event="rowSelect" update="waveForm:toolbar" />
									<p:column headerText="名称">
										<h:outputText value="#{waveEquipment.name}" />
									</p:column>
									<p:column headerText="厂站名称">
										<h:outputText value="#{waveEquipment.subName}" />
									</p:column>
								</p:dataTable>
								<p:dialog id="createWaveEquipment" widgetVar="createWaveEquipment" height="150px">
									<p:toolbar>
										<f:facet name="right">
											<p:commandButton value="确定" actionListener="#{waveEquipmentController.saveWaveEquipment}"
												update="waveForm:waveEquipmentDataTable form2:tree waveForm:msgs waveForm"
												oncomplete="PF('createWaveEquipment').hide()" />
										</f:facet>
									</p:toolbar>
									<p:panelGrid columns="2">
										<p:outputLabel value="录波器名称" />
										<p:inputText style="width:300px" value="#{waveEquipmentController.preWaveEquipment.name}" />
									</p:panelGrid>
								</p:dialog>
							</h:form>
						</div>
					</div>
				</div>
				<div class="chart tab-pane" id="equipmentInfo">
					<div class="box">
						<div class="box-body full-content-scroll">
							<h:form id="equipmentInfoForm">
								<p:dataTable id="equipmentInfoTb" var="cfgch" emptyMessage="无记录"
									value="#{waveEquipmentController.equipmentNames}" rowKey="#{cfgch}" selectionMode="single"
									style="margin-bottom:20px">
									<p:column headerText="名称" style="width:80px;text-align: center">
										<h:outputText value="#{cfgch}" />
									</p:column>
								</p:dataTable>
							</h:form>
						</div>
					</div>
				</div>
			</div>
		</div>
		<div class="nav-tabs-custom" id="statistics">
			<h:form id="form">
				<div class="box box-solid with-border">
					<div class="box-header">
						<h:outputText value="所属变电站：" style="margin-left:10px" />
						<p:inputText id="subtationNameText" value="#{waveRecorderConfigController.subtationName}"
							disabled="#{waveRecorderConfigController.noSubtation == true}" />
						<h:outputText value="设备名称：" style="margin-left:10px;" />
						<p:inputText id="deviceNameText" value="#{waveRecorderConfigController.equipmentName}" />
						<p:commandButton style="margin-left:10px;" icon="ui-icon-search" value="查询" update="table"
							actionListener="#{waveRecorderConfigController.query}" />
						<p:commandButton icon="ui-icon-refresh" value="重置"
							actionListener="#{waveRecorderConfigController.reset}"
							update="table subtationNameText deviceNameText" style="margin-left:5px;" />
					</div>
				</div>
				<p:dataTable id="table" var="item" selection="#{waveRecorderConfigController.selected}"
					value="#{waveRecorderConfigController.model}" rowIndexVar="ite" lazy="true" rowKey="#{item.id}"
					style="margin-bottom:0;text-align:center" emptyMessage="无记录" rows="20" paginator="true"
					paginatorTemplate="{Customization} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
					rowsPerPageTemplate="20,50,100" paginatorPosition="bottom">
					<f:facet name="{Customization}">
						<p:outputLabel value="总计：#{waveRecorderConfigController.rowCount} 条记录"
							style="margin-right:20px;" />
					</f:facet>
					<p:column style="width:20px" headerText="序号 ">
						<h:outputText value="#{ite+1}" />
					</p:column>
					<p:column width="60" headerText="设备名称">
						<h:outputText value="#{item.name}" />
					</p:column>
					<p:column width="60" headerText="所属变电站">
						<h:outputText value="#{item.subName}" />
					</p:column>
					<p:column width="60" headerText="设备厂家">
						<h:outputText value="#{item.devManufacturer}" />
					</p:column>
					<p:column width="60" headerText="设备型号">
						<h:outputText value="#{item.devType}" />
					</p:column>
				</p:dataTable>
			</h:form>
		</div>
	</ui:define>
	<ui:define name="contentend">
		<script src="/resources/plugins/datatables/jquery.dataTables.js"></script>
		<script src="/resources/plugins/datatables/dataTables.bootstrap.min.js"></script>
		<script src="/resources/js/tables/mytable.js"></script>
		<script src="/resources/js/mymodal.js"></script>
		<script src="/resources/plugins/snapsvg/snap.svg.js"></script>
		<script>
		$(document).ready(function(){
			$("#tabView").hide(); 
			});
		var menushow = false;
		function showSvg(){
			$("#maindiv").empty();
			var svgtxt = $("#form3\\:svgtext").val();
			if(svgtxt &amp;&amp; svgtxt.length > 0){
				if(svgtxt=="1"){
					$("#accountTitle").html("");
					$("#tabView").show();
					$("#svgView").hide();
				}else{
					$("#tabView").hide();
					$("#svgView").show();
					$("#maindiv").append(svgtxt);
					$("svg").attr("id","svgid" );
					var svg = Snap("#svgid");
					svg.drag();
					var svg= $("svg:first");
					if(svg){
						var w = svg.attr("width");
						var h = svg.attr("height");
						svg.removeAttr('viewBox');
						svg.attr("viewBox","0 0 "+w+" "+h);
					}
		 		}
		   }else{
			   	$("#tabView").hide();
				$("#svgView").show();
			    $("#accountTitle").html("");
		   }
			    $("#statistics").hide();
		}
		</script>
	</ui:define>
</ui:composition>
